#ifndef _PROGRESSBAR_H_LULY
#define _PROGRESSBAR_H_LULY
#include "../NinePatch.h"
#include "UIObject.h"
//水平进度条
class ProgressBar : public UIObject {
 protected:
  double currentProgress = 0;  //当前进度比率 (小数0到1)
  NinePatch* background_ninePatch = nullptr;
  NinePatch* front_ninePatch = nullptr;

  void drawArea(const Rect& area) override;

 public:
 //defaultProgress默认进度比率 (小数0到1)
  ProgressBar(std::string uiObjectId, double defaultProgress=0, const int x = 0,
              const int y = 0, const int width = 0, const int height = 0);
  void setProgress(double progress);
  const double getProgress(){return currentProgress;}
  ~ProgressBar();
};

#endif